﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Staticage.Core {
    /// <summary>
    /// 应用程序配置接口
    /// 配置分为两级
    /// 第一级section
    /// 第二级key
    /// 根据section和key可取到配置值
    /// </summary>
    public interface IConfiguration {
        /// <summary>
        /// 选择配置的section 
        /// </summary>
        /// <param name="section"></param>
        /// <returns></returns>
        IConfiguration Select(string section);

        /// <summary>
        /// 获取配置值
        /// </summary>
        string GetValue(string key);

        /// <summary>
        /// 设置配置值
        /// </summary>
        IConfiguration SetValue(string key, object value);

        /// <summary>
        /// 保存配置
        /// </summary>
        IConfiguration Save();
    }
}
